#include "cMorse.h"

Morse::Morse(){
	D=1.0;
	set_k(1);
	setName("Morse Potential");
	setUniverse(75.0);
	setWidth(getUniverse());
	setPotLeft(0.0);
	setPotRight(getWidth());
	setFx(getUniverse());
	setTx(0.0);
        setUniLeft(0.0);
        setUniRight(getUniverse());
	setMinEnergy(-D);
	a=sqrtl(1.0/(2.0*D));
	//Distance between nuclei of bonded carbon atoms
	//r = (0.154 * pow10(-9)) / atomic_length_m;
	r=1.0;
	//filter[activefilter]->calculate(this);
}

Morse::~Morse()
{
}

double Morse::getPotentialValueAt(double x) {
	return D*(1.0-exp(-1.0*a*(x-r)))*(1.0-exp(-1.0*a*(x-r)));
}
